package com.yunzhi.controller;

import com.yunzhi.domain.RequestHeader;
import com.yunzhi.domain.ResultConstant;
import com.yunzhi.util.RequestUtil;
import com.yunzhi.util.ResponseUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@Controller
@RequestMapping("/yzWithdrawals")
public class WithdrawDepositController {
	private static final Log logger = LogFactory.getLog(WithdrawDepositController.class);

	@RequestMapping("/dealWithdrawal")
	public void dealWithdrawal(HttpServletRequest request, HttpServletResponse response) throws Exception {
		if (!RequestUtil.validSign(request)) {
			ResponseUtil.write(response, ResultConstant.INVALID_SIGN);
			return;
		}
		if (!RequestUtil.validToken(request)) {
			ResponseUtil.write(response, ResultConstant.INVALID_TOKEN);
			return;
		}
		RequestHeader header = RequestUtil.decodeHeader(request);
		if (header.getUserId() == null) {
			ResponseUtil.write(response, ResultConstant.NOT_LOGIN);
			return;
		}
		Map map = RequestUtil.decodeData(request);


	}


}